package com.koo.modules.product.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.koo.modules.product.entity.ProductInfoEntity;
import com.koo.modules.product.entity.vo.ProductVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 
 * 
 * @author charlin
 * @email 136137465@qq.com
 * @date 2022-12-20 16:45:05
 */
@Mapper
public interface ProductInfoDao extends BaseMapper<ProductInfoEntity> {

    IPage<ProductInfoEntity> listByPage(IPage<ProductInfoEntity> page, @Param("ew") QueryWrapper<ProductInfoEntity> wrapper);

    IPage<ProductVo> listByPageWithParams(IPage<ProductVo> page, @Param("ew")  QueryWrapper<ProductVo> wrapper);

    String selectMaxCode(@Param("storeId") Long storeId);

    List<ProductVo> listProduct(@Param("storeId") Long storeId);

    Integer getUpPriceCount(@Param("storeId") Long storeId);

    Integer getDownPriceCount(@Param("storeId") Long storeId);
}
